package com.douwong.student.socket;

import com.douwong.student.enums.E_CommandType;
import com.douwong.student.enums.E_Destination;
import com.douwong.student.model.TcpPacket;

/**
 * @autor yichao
 * @time 2017/3/2916:07
 * @des ${TODO}
 */
public class TcpPacketUtils {
    /**
     * 长连接发送消息
     * @param obj
     * @param commandType
     * @param from
     * @param to
     * @param senndId
     * @param receiveId
     * @return
     */
    public static  TcpPacket sendData(Object obj,E_CommandType commandType,E_Destination from,E_Destination to,int senndId,int[] receiveId){
        TcpPacket packet=new TcpPacket();
        packet.commandType=commandType;
        packet.from=from;
        packet.to=to;
        packet.senderId=senndId;
        packet.receiveId=receiveId;
        packet.data=obj;
        return packet;
    };


}
